#ifndef MW_MPI_H
#define MW_MPI_H


/** Meanwhile */


#include <glib.h>


G_BEGIN_DECLS


/** @file mw-mpi.h
    @since 2.0.0 

    Wrapper for necessary multiple-precision functions. Abstracts away
    the details from using either libgcrypt, libgmp, or the built-in
    libmp */


typedef struct mw_mpi MwMPI;


MwMPI *mw_mpi_new();


MwMPI *mw_mpi_dup(const MwMPI *i);


void mw_mpi_free(MwMPI *i);


void mw_mpi_import(MwMPI *i, const guchar *buf, gsize len);


void mw_mpi_export(const MwMPI *mpi, guchar **buf, gsize *len);


void mw_mpi_set(MwMPI *to, const MwMPI *from);


void mw_mpi_setul(MwMPI *mpi, gulong l);


void mw_mpi_set_random(MwMPI *to, guint bits);


void mw_mpi_modpw(MwMPI *result, const MwMPI *i, const MwMPI *pow,
		  const MwMPI *mod);


G_END_DECLS


#endif /* MW_MPI_H */
